<template>
  <view class="order-card-container">
    <Base v-if="type=='base'" :data="data" />
    <Delivery v-if="type=='delivery'" :data="data" />
  </view>
</template>

<script>
import GoodsInfo from "./GoodsInfo.vue";
import Base from "./Base.vue";
import Delivery from "./Delivery.vue";
export default {
  components: {
    GoodsInfo,
    Base,
    Delivery
  },
  props: {
    type: {
      type: String,
      default() {
        // base普通 delivery外送
        return "delivery";
      }
    },
    data: {
      type: Object,
      default() {
        return {
          tableNo: "13桌",
          createdAt: "2020-05-06",
          status: 2,
          orderGoods: [
            {
              id: 105,
              orderId: 83,
              skuId: 44,
              num: 1,
              title: "鱼香肉丝",
              price: "16.78",
              spec: [
                {
                  key: "分量",
                  value: "大份"
                }
              ],
              props: []
            },
            {
              id: 105,
              orderId: 83,
              skuId: 44,
              num: 1,
              title: "鱼香肉丝",
              price: "16.78",
              spec: [
                {
                  key: "分量",
                  value: "大份"
                }
              ],
              props: [
                {
                  k: "辣度",
                  v: ["辣"],
                  id: "辣度辣"
                }
              ]
            }
          ],
          buyerRemark: "啊都快放假啦谁放假了撒的方式地方",
          total: "15.20"
        };
      }
    }
  },
  data() {
    return {
      showMore: false
    };
  },
  computed: {
    totalNum() {
      let a = 0;
      this.data.orderGoods.forEach(v => {
        a = a + v.num;
      });
      return a;
    },
    // 桌台及区域名
    areaName() {
      return this.data.tableInfo.groupName + " " + this.data.tableInfo.tableNo;
    }
  },
  methods: {}
};
</script>

<style scoped lang="scss">
</style>
